<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\EduActiveOrderSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '线下订单';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="edu-active-order-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('Create Edu Active Order', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'id',
            'user_id',
//            'openid',
            'active_id',
            'out_trade_no',
            'total_fee',
            //'logistic_fee',
            'count',
//            'status',
            [
                'attribute' => 'status',
                'enableSorting' => false,
                'value' => 'statusValue',
                'filter' => \backend\models\EduActiveOrder::attributeValue()['status']
            ],
            'create_time:datetime',
            //'sex',
            //'name',
            //'phone',
            //'make_time:datetime',
            //'day_up',
            //'address',
            //'logistics',
            //'order_num',
            //'add_phone',
            //'add_name',
            //'experience',
            //'follow_teach',
            //'puzzled',
            //'perfect',
            //'brand',
            //'fill_in',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
</div>
<?php
$script = <<< JS
    $(".pagination").append('&nbsp;跳转<input id="invalue" type="text" style="border-radius: 5px;outline: none;border: solid 1px #dddddd;width: 52px;height: 34px;text-align: center;" class="pane"/>页&nbsp;<button id="skip" class="btn btn-default skip ok"">确定</button>');
    
    $('#skip').click(function() {
        var page = $('#invalue').val();
        location.href = "index.php?r=edu-active-order/index&page="+ page;
    }); 
JS;
$this->registerJs($script);
?>